<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
    <title>Template</title>
</head>
<body>
    <h1>Template</h1>
    <hr>
    <div id="app">
    	<mycomponemt></mycomponemt>
    	<testcomponent></testcomponent>
    </div>
    <div id="app2">
    	<mycomponemt></mycomponemt>
    </div>    

    <script type="text/javascript">
    
    	Vue.component('mycomponemt',{
    		template:'<div style="color:red">全局组件</div>',
    	})
    
        var app=new Vue({
            el:'#app',
            components:{
            	"testcomponent":{
            		template:'<div style="color:black">局部组件</div>'
            	}
            }
        })
        var app2=new Vue({
            el:'#app2'
        })
	</script>
</body>
</html>